package com.ansuenjob.jsonBuilder;

import org.json.JSONException;
import org.json.JSONObject;

import com.ansuenjob.model.Company;
import com.ansuenjob.model.Job;
import com.ansuenjob.vo.JobVO;

public class JobVoBuilder extends JSONBuilde<JobVO>{

	@Override
	public JobVO buildJson(JSONObject jsonObject) throws JSONException {
		CompanyBuilder comBuilder = new CompanyBuilder();
		JobBuilder jobBuilder = new JobBuilder();				
		JSONObject jCompany = jsonObject.getJSONObject("postCompany");
		JSONObject jJob	= jsonObject.getJSONObject("companyJob");
		Company company = comBuilder.buildJson(jCompany);
		Job job = jobBuilder.buildJson(jJob);
		JobVO jobVo = new JobVO(job, company);
		return jobVo;
	}

}
